2 Problem: 11385 - Da Vinci Code
3 Author: Andrés Mejía-Posada
5 Que gonorrea de problema.
18 fib
[0] = 1, fib
[1] = 2;
19 for (int i
=2; fib
[i
-1] + fib
[i
-2] > 0; ++i
) fib
[i
] = fib
[i
-1] + fib
[i
-2];
21 for(cin
>> T
; T
--; cout
<< ans
<< endl
){
24 for (int i
=0; i
<n
; ++i
) cin
>> nums
[i
];
26 getline(cin
, s
), getline(cin
, s
);
27 for (int i
=0; i
<s
.size(); ++i
) if (!isupper(s
[i
])) s
.erase(i
, 1), i
--;
30 for (int i
=0; i
<n
; ++i
) pos
[i
] = lower_bound(fib
, fib
+ 50, nums
[i
]) - fib
;
32 ans
= string(*max_element(pos
.begin(), pos
.end()) + 1, ' ');
34 for (int i
=min(s
.size(), pos
.size()) - 1; i
>= 0; --i
) ans
[pos
[i
]] = s
[i
];